import { deleteLocalInfo, getLocalInfo, setLocalInfo } from "@/utils/storage"

const state = ()=>{

    return {
        userinfo: getLocalInfo()
    }
}

const mutations = {
    setVuexUserinfo(data){ 

        console.log('到这里了')
        console.log(data)
        const dataa = Object.assign({}, data)
        console.log(dataa)

        setLocalInfo(JSON.stringify(dataa.userinfo))
        // setLocalInfo(obj)
    },
    deleteUserinfo(){
        deleteLocalInfo()
    }
}


export default {
    namespaced: true,
    state,
    mutations
}